#ifndef FINANCE_INNERKITS_IKEYBOARD_ADAPTOR_H
#define FINANCE_INNERKITS_IKEYBOARD_ADAPTOR_H

#include "iadaptor.h"
#include "keyboard_def.h"

namespace SwanLink {
namespace Finance {
class iKeyboard_Adaptor : public IAdaptor
{
public:
    virtual bool IsSM4Enabled() = 0;
	/**
	 * 获取密码键盘序列号
	 */
    virtual int GetSN(char sn[], int &len) = 0;
	/**
	 * 计算MAC
	 */
    virtual int CalculateMAC(const KeyInfo& key, char plain[], int len, char enc_data[], int &enc_len) = 0;
	/**
	 * 加密数据
	 */
    virtual int EncryptData(const KeyInfo& key, char plain[], int len, char enc_data[], int &len_enc) = 0;
	/**
	 * 设置PIN的长度限制
	 */
    virtual int SetPINLength(int minLen, int maxLen) = 0;
	/**
	 * 设置明文密文模式
	 */
    virtual int SetTextMode(TextMode mode) = 0;
	/**
	 * 清空文本
	 */
    virtual void ClearTextMode() = 0;
	/**
	 * 加载主密钥
	 */
    virtual int LoadMasterKey(KeyID masterKeyID, unsigned char *KeyValue) = 0;
	/**
	 * 加载用户密钥
	 */
    virtual int LoadUserKey(KeyID masterKeyID, userKeyType user_Key_Type, unsigned char *KeyValue) = 0;
	/**
	 * 更新密钥
	 */
    virtual int UpdateMasterKey(KeyID masterKeyID, unsigned char *KeyValue) = 0;
	/**
	 * 更新用户密钥
	 */
    virtual int UpdateUserKey(KeyID masterKeyID, userKeyType user_Key_Type, unsigned char *KeyValue) = 0;
	/**
	 * 删除用户密钥
	 */
    virtual int DeleteUserKey(KeyID masterKeyID, userKeyType user_Key_Type) = 0;
	/**
	 * 监听
	 */
    virtual void ListenForPin(PinListener* listener, int timeout) = 0;
};
} // namespace Finance
} // namespace SwanLink
#endif
